﻿using Exam.infrastructure.Attr;
using Exam.infrastructure.EFCore;
using Exam.infrastructure.IOC;
using Exam.Service.Interface;
using System;
using System.Collections.Generic;
using System.Text;

namespace Exam.Service.Instance
{
    [Inject_]
    public class Log_Service : I_Log_Service
    {
        private readonly Log_IOC _log_IOC;

        public Log_Service(Log_IOC log_IOC) {

            _log_IOC = log_IOC;
        }
        public int Add_Action_Log(SysActionLogs sysActionLogs)
        {
            _log_IOC._sys_Action_Log_EFCore.Add(sysActionLogs);
            var result = _log_IOC._sys_Action_Log_EFCore.SaveChanges();

            return result;
        }

        public int Add_Error(SysErrorLogs sysErrorLogs)
        {
            _log_IOC._sys_Error_Log_EFCore.Add(sysErrorLogs);
            return _log_IOC._sys_Error_Log_EFCore.SaveChanges();
        }
    }
}
